<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加灵敏度</title>
    <style>
        .two-part-label{
            width: 300px !important;
        }
    </style>
</head>
<body>
<form class="layui-form" lay-filter="layui-form">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
                <blockquote class="layui-elem-quote">信息</blockquote>

                <div class="layui-form-item">
                    <label class="layui-form-label">作者</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="author_id"
                             data-sourceType="route"
                             data-source="/admin.peace.author/author"
                             data-params='{"search_param":{"type":{"value":1,"condition":"="}}}'
                             data-textField="author_name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">设备</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="device"
                             data-sourceType="data"
                             data-radio="true"
                             data-source="[{name:'手机',value:'手机'},{name:'平板',value:'平板'}]"
                             data-selected="{{=d.device}}"
                        ></div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">手指</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="finger"
                             data-sourceType="data"
                             data-radio="true"
                             data-source="[{name:'二指',value:'二指'},{name:'三指',value:'三指'},{name:'四指',value:'四指'},{name:'多指',value:'多指'}]"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">灵敏度码</label>
                    <div class="layui-input-block">
                        <input type="text" id="code" name="code" class="layui-input" lay-verify="required|code" lay-reqtext="请输入灵敏度码" placeholder="请输入灵敏度码" value="">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">开镜</label>
                    <div class="layui-input-block">
                        <input type="text"  name="mirror_remark" class="layui-input"  placeholder="请输入开镜描述" value="">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">陀螺仪</label>
                    <div class="layui-input-block">
                        <input type="text"  name="gyroscope_remark" class="layui-input"  placeholder="请输入陀螺仪描述" value="">
                    </div>
                </div>


                <blockquote class="layui-elem-quote">自由镜头</blockquote>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第三人称人物、载具状态自由镜头（小眼睛）</label>
                        <div class="layui-input-inline">
                            <input type="number" name="free_camera-1" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值" class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">跳伞状态自由镜头（小眼睛）</label>
                        <div class="layui-input-inline">
                            <input type="number" name="free_camera-2" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第一人称人物自由镜头（小眼睛）</label>
                        <div class="layui-input-inline">
                            <input type="number" name="free_camera-3" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>

                </div>


                <blockquote class="layui-elem-quote">镜头</blockquote>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第三人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-1" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第一人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-2" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">红点、全息、机瞄、侧面瞄准镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-3" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">2倍镜、Win94、P90、猎弓</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-4" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">3倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-5" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">4倍镜、VSS</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-6" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">6倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-7" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">8倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="camera-8" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>

                <blockquote class="layui-elem-quote">开火镜头</blockquote>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第三人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-1" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第一人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-2" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">红点、全息、机瞄、侧面瞄准镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-3" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">2倍镜、Win94、P90、猎弓</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-4" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">3倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-5" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">4倍镜、VSS</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-6" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">6倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-7" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">8倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_camera-8" lay-verify="required|number|point1" max="300" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point1">
                        </div>
                    </div>
                </div>



                <blockquote class="layui-elem-quote">陀螺仪</blockquote>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第三人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-1" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第一人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-2" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">红点、全息、机瞄、侧面瞄准镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-3" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">2倍镜、Win94、P90、猎弓</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-4" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">3倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-5" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">4倍镜、VSS</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-6" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">6倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-7" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">8倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="gyroscope-8" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>



                <blockquote class="layui-elem-quote">开火陀螺仪</blockquote>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第三人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-1" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">第一人称不开镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-2" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">红点、全息、机瞄、侧面瞄准镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-3" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">2倍镜、Win94、P90、猎弓</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-4" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">3倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-5" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">4倍镜、VSS</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-6" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">6倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-7" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">8倍镜</label>
                        <div class="layui-input-inline">
                            <input type="number" name="fire_gyroscope-8" lay-verify="required|number|point2" max="400" autocomplete="off" placeholder="请输入百分比数值"  class="layui-input point2">
                        </div>
                    </div>
                </div>
                <input type="hidden" name="type" value="1" />

            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="laytp-btn laytp-btn-primary laytp-btn-sm" lay-submit="" lay-filter="add">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="laytp-btn laytp-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script>
    if(localStorage.getItem("staticDomain")){
        document.write("<link rel='stylesheet' href='" + localStorage.getItem("staticDomain") + "/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/layui/layui.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/laytp/layuiConfig.js?v="+localStorage.getItem("version")+"'><\/script>");
    }else{
        document.write("<link rel='stylesheet' href='/static/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='/static/component/layui/layui.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='/static/component/laytp/layuiConfig.js?v="+localStorage.getItem("version")+"'><\/script>");
    }
</script>
<script>
    layui.use(['laytp'],function(){
        layui.form.verify({
            point1:function(value,item){
                if(value > 300){
                    return '最大值为300%';
                }
            },
            point2:function(value,item){
                if(value > 400){
                    return '最大值为400%';
                }
            },
            code:function(value,item){
                if(value.length != 22 ){
                    return '灵敏度码格式不正确';
                }
            }
        });

        $("#code").blur(function(){
            var value = this.value;
            var node = this;
            if(value.length != 22 ){
                layer.tips('灵敏度码格式不正确','#code',{
                    tips:[3,'red']
                })
                node.focus();
            }
        })


        $(".point1").blur(function(){
            var value = this.value;
            var node = this;
            if(value > 300 ){
                layer.tips('最大值为300%',this,{
                    tips:[3,'red']
                })
                node.focus();
            }
        })

        $(".point2").blur(function(){
            var value = this.value;
            var node = this;
            if(value > 400 ){
                layer.tips('最大值为400%',this,{
                    tips:[3,'red']
                })
                node.focus();
            }
        })

        layui.form.on('submit(add)', function(data){
            var btnAnim = layui.button.load({elem:$(this)});
            facade.ajax({
                route:'/admin.peace.record/add',
                data : data.field
            }).done(function(res){
                if(res.code === 0){
                    parent.layui.layer.close(parent.layui.layer.getFrameIndex(window.name));//关闭当前页
                    parent.layui.table.reload("laytp-table");
                }
                btnAnim.stop();
            }).fail(function(){
                btnAnim.stop();
            });
            return false;
        });
    })
</script>
</body>
</html>